//https:// codeforces.com/gym/104369
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define debug(x) cout << #x << " = " << x << '\n'
#define INF 0x3f3f3f3f3f3f3f3f
        using namespace std;

int s[105];
int y1, y2, n;

void solve()
{
    cin >> y1;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
    }
    cin >> y2;
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        if (s[i] < y2)
            count++;
    }
    cout << (y2 - y1 + 1 - count) << endl;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--)
        solve();
    return 0;
}